#include "connection.h"
Connection *Connection::instance = nullptr;
Connection::Connection(QObject *parent)
    : QObject{parent}
{
    m_ptrStumysql = new stumySql();
}

Connection::~Connection()
{
    delete m_ptrStumysql;
}

Connection *Connection::getInstance()
{
    if (instance == nullptr) {
        instance = new Connection();
    }
    return instance;
}

void Connection::initDatabase()
{
    m_ptrStumysql->init(); // 调用stumysql类中的init()函数进行数据库连接
}

stumySql *Connection::getDatabase()
{
    return m_ptrStumysql;
}
